<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*"%>
<%
	request.setAttribute("path", request.getContextPath());
%>
<OBJECT id=WebOffice1 style="LEFT: 0px; TOP: 0px; WIDTH: 100%; HEIGHT:95%" codebase="weboffice_v6.0.5.0.cab" classid="clsid:E77E049B-23FC-4DB8-B756-60529A35FAD5">
</OBJECT>
<html>
  <head>
  	<link rel="stylesheet" href="${path}/portal/css/bootstrap.min.css" type="text/css" />
	<link rel="stylesheet" href="${path}/portal/css/bootstrap-theme.min.css" type="text/css" />
	<script type="text/javascript" src="${path}/portal/js/jq/bootstrap.min.js"></script>
	<script type="text/javascript" src="${path}/portal/js/base/common.js"></script>
    <title>Web Office</title>
	<SCRIPT LANGUAGE=javascript FOR=WebOffice1 EVENT=NotifyCtrlReady>
		/****************************************************
		*
		*	在装载完Weboffice(执行<object>...</object>)
		*	控件后执行 "WebOffice1_NotifyCtrlReady"方法
		*
		****************************************************/
			WebOffice1_NotifyCtrlReady()
	</SCRIPT>
	<SCRIPT LANGUAGE=javascript FOR=WebOffice1 EVENT=NotifyWordEvent(eventname)>
		 WebOffice1_NotifyWordEvent(eventname)
	</SCRIPT>
  </head>
  
  <body>
  
  <div class="form-horizontal" style="margin-top: 10px;text-align:center;width: 100%">
  	<button type="button" class="btn btn-default" onclick="showRevisions()">显示痕迹</button>
  	<button type="button" class="btn btn-default" onclick="unShowRevisions()">隐藏痕迹</button>
  	<button type="button" class="btn btn-primary" onclick="saveDoc()">保存</button>
  </div>
   <script type="text/javascript">
       	function WebOffice1_NotifyCtrlReady() {
			document.all.WebOffice1.OptionFlag |= 128;
			document.all.WebOffice1.LoadOriginalFile("../getfile.jsp?filename=${param.fullPath}","${param.docType}");
			document.all.WebOffice1.SetToolBarButton2("Standard",1,0);   
			
		}
    </script>
	<script type="text/javascript">
			function saveDoc() {
				try{
					var webObj=document.getElementById("WebOffice1");
					webObj.HttpInit();
					webObj.HttpAddPostString("orgPath", "${param.fullPath}");
					webObj.HttpAddPostCurrFile("filebody","");	
					returnValue = webObj.HttpPost("../savedoc.jsp");
					if("succeed" == returnValue){
						common.modalGlobalMessage("文件上传成功");	
					}else if("failed" == returnValue)
						common.modalGlobalMessage("文件上传失败");
					return_onclick(); 
				}catch(e){
					common.modalGlobalMessage("异常\r\nError:"+e+"\r\nError Code:"+e.number+"\r\nError Des:"+e.description);
				}
			}	
			function return_onclick() {
				try{
					var webObj=document.getElementById("WebOffice1");
					webObj.Close();
					window.location.reload();
				}catch(e){
					common.modalGlobalMessage("异常\r\nError:"+e+"\r\nError Code:"+e.number+"\r\nError Des:"+e.description);
				}
			}

			function unShowRevisions() {
				try{
					var webObj=document.getElementById("WebOffice1");
					webObj.ShowRevisions(0);
				}catch(e){
					common.modalGlobalMessage("异常\r\nError:"+e+"\r\nError Code:"+e.number+"\r\nError Des:"+e.description);
				}
			}
			function showRevisions() {
				try{
					var webObj=document.getElementById("WebOffice1");
					webObj.ShowRevisions(1);
				}catch(e){
					common.modalGlobalMessage("异常\r\nError:"+e+"\r\nError Code:"+e.number+"\r\nError Des:"+e.description);
				}
			}
		</script>       
  </body>
</html>
